 //
//  JYJMyCardViewController.m
//  JYJSlideMenuController
//
//  Created by JYJ on 2017/6/16.
//  Copyright © 2017年 baobeikeji. All rights reserved.
//

#import "JYJMyCardViewController.h"
#import "ProfileViewCell.h"
#import "UserSites.h"

@interface JYJMyCardViewController ()<UITabBarDelegate,UITableViewDataSource>
@property (nonatomic,strong) UITableView* tableView;
@end

@implementation JYJMyCardViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    [self setupUI];
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.tableView.frame = self.view.bounds;
}

-(void)setupUI{
    UITableView *tableView = [[UITableView alloc] init];
    tableView.scrollEnabled = NO;
    tableView.delegate = self;
    tableView.dataSource = self;
    tableView.separatorStyle = UITableViewCellSelectionStyleNone;
    tableView.showsVerticalScrollIndicator = NO;
    tableView.backgroundColor = [UIColor clearColor];
    [self.view setBackgroundColor:XMColor(241, 245, 247)];
    [self.view addSubview:tableView];
    self.tableView = tableView;
    //
    self.navigationController.xm_backgroundColor=DGColor;
}
#pragma mark - TableView DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    // 创建cell
    ProfileViewCell *cell = [ProfileViewCell cellWithTableView:tableView];
    cell.backgroundColor=[UIColor whiteColor];
//    cell.item = self.data[indexPath.row];
    UserSites* site=[UserSites mj_objectWithKeyValues:[UserInfo share].sites[0] ];
//    cell.siteName.text=site.siteName;
//    cell.phoneText.text=[UserInfo share].telephone;
    cell.siteName.text=@"联系方式";
    cell.phoneText.text=@"888IT@adenservices.com";
    [cell.phoneText setTextColor:[UIColor lightGrayColor]];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 100;
}
-(CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section{
    return 50;
}
-(UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section{
    UIView* v=[[UIView alloc] init];
    [v setBackgroundColor:XMColor(241, 245, 247)];

    return v;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
//    JYJCommenItem *item = self.data[indexPath.row];
//    if (item.destVcClass == nil) return;
//    
//    JYJPushBaseViewController *vc = [[item.destVcClass alloc] init];
//    vc.title = item.title;
//    vc.animateViewController = (JYJAnimateViewController *)self.parentViewController;
//    [self.parentViewController.navigationController pushViewController:vc animated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
